#include <stdio.h>
#include <math.h>
#define PI 3.141592654

void CarToTar(double x_car, double y_car, double l0, double l1, int a, int b, double* x_tar, double* y_tar)
{
    a = 90 - a;
    b = 90 + a - b;
 
    *x_tar = x_car+l0*cos(a*PI/180)+l1*cos(b*PI/180);
    *y_tar = y_car+l0*sin(a*PI/180)+l1*sin(b*PI/180); 
}

int main()
{
    double x,y,l0,l1,X,Y;
    int a,b;

    while(1)
    {
        printf("请输入车x,车y,雷达距离,障碍物距离,航向角,雷达角:\n");
        scanf("%lf %lf %lf %lf %d %d",&x,&y,&l0,&l1,&a,&b);
        CarToTar(x,y,l0,l1,a,b,&X,&Y);
        printf("目标坐标:\n%lf  %lf\n",X,Y);
    }
}
